#include"../server.hpp"
int main()
{
    std::unique_ptr<Socket> client(new Socket);
    if(client->CreateClient(8888,"127.0.0.1")==false)
    {
        ERROR_LOG("建立连接失败");
        return -1;
    }
    for(int i=0;i<20;++i)
    {
        std::string str="hello"+std::to_string(i);
        client->Send(str.c_str(),str.size());
        char buff[1024]={0};
        int n=client->Recv(buff,1023);
        if(n<0)
        {
            INFO_LOG("连接以断开");
            break;
        }
            
        buff[n]=0;
        INFO_LOG("收到:%s",buff);
        sleep(1);
    }
    client->Close();
}